package com.deepplin.mongodbmanager.model;

import com.mongodb.MongoClient;

public class MongoDBSession {

	private String UserName;
	private boolean bCheckSession;
	private MongoClient mongoClient;
	private String HOST;;
	private int PORT;	
	
	private static MongoDBSession mgSession = null;
	
	private MongoDBSession(){
		this.setbCheckSession(false); // Session 초기값 지정 :
	}
	
	public static MongoDBSession getInstance(){
		if( mgSession == null){
			mgSession = new MongoDBSession();
			
		}		
		return mgSession;
	}	
	
	public MongoClient getMongoClient() {
		return mongoClient;
	}	
	public void setMongoClient(MongoClient mongoClient) {
		this.mongoClient = mongoClient;
	}
	
	public String getStrUserName() {
		return UserName;
	}
	public void setStrUserName(String strUserName) {
		this.UserName = strUserName;
	}
	
	public boolean isbCheckSession() {
		return bCheckSession;
	}	
	public void setbCheckSession(boolean bCheckSession) {
		this.bCheckSession = bCheckSession;
	}
	
	public void setServerInfo( String HOST, String PORT){
		this.HOST = HOST;
		try {
			this.PORT = Integer.parseInt( PORT);	
		} catch (NumberFormatException e) {
			System.out.println("PORT 확인");
		} 
		
	}	
	public String getHOST() {
		return HOST;
	}
	public int getPORT() {
		return PORT;
	}
	
	
}
